package com.dhl.iterator.college;

import com.dhl.iterator.College;
import com.dhl.iterator.Department;
import com.dhl.iterator.Iterator;

import java.util.ArrayList;
import java.util.List;

/**
 * @title: InfoCollege
 * @Author danghailiang
 * @Date: 2022/8/20 16:47
 * @Version 1.0
 */
// 信息学院
public class InfoCollege implements College {

    private List<Department> departments;

    public InfoCollege() {
        departments = new ArrayList<>();
        departments.add(new Department("信息安全专业", "信息安全专业"));
        departments.add(new Department("网络安全专业", "网络安全专业"));
        departments.add(new Department("服务器安全专业", "服务器安全专业"));
    }

    @Override
    public Iterator createIterator() {
        return new InfoCollegeIterator(departments);
    }

    @Override
    public String getName() {
        return "信息学院";
    }

    @Override
    public void addDepartment(String name, String desc) {
        departments.add(new Department(name, desc));
    }
}
